
import java.io.*;
import java.util.ArrayList;
/**
 *
 * @author Chris
 */
public class RunIntellius {
    public static void main(String[] args) throws Exception {
        if (args.length != 3) {
            System.err.println("Usage:  RunGoogle querySrc urlDest pageCount");
            System.exit(1);
        }
        int maxPage = Integer.parseInt(args[2]);
        BufferedReader read = new BufferedReader(new FileReader(args[0]));
        PrintWriter out = new PrintWriter(new FileWriter(args[1]));
       // IntelliusQuery google = new IntelliusQuery(2500, 2500, 2500, 2500);
        BeenVerified beenVerified = new BeenVerified(2500, 2500, 2500, 2500);
        String query;
        ArrayList<SearchResult> list;

        ArrayList<SearchResult> beenVerifiedList;
        query = read.readLine();
        while (query != null) {
           // list = google.getResultsWithDelay(query, 1, maxPage);
        	beenVerifiedList = beenVerified.getResultsWithDelay(query, 1, maxPage);

//            for (int c = 0; c < list.size(); c++) {
//                out.println(list.get(c).getUrl());
//            }

        	
        	  for (int c = 0; c < beenVerifiedList.size(); c++) {
               out.println(beenVerifiedList.get(c).getUrl());
            }
        	
            out.println();
            beenVerified.queryDelay();
            
            query = read.readLine();
        }

        out.close();
    }
}



